# -*- encoding: utf-8 -*-
print("----------捕获异常----------")
try:
    a=input("How many apples do you habe:")
    weight = int(a) * 2
    print("You have",weight,"kg apples.")
except ValueError:
    print("Please enter a valid integer.")
else:
    print("Nothing Wrong")

print("----------捕获多个异常----------")
try:
    i = int("123")
    j = i / 0
    print("this line never excute!")
except ValueError:
    print("ValueError")
except ZeroDivisionError:
    print("ZeroDivisionError")
else:
    print("Nothing Wrong")

print("----------捕获所有异常----------")
try:
    i = int("123")
    j = i / 0
    print("this line never excute!")
except ValueError:
    print("ValueError")
except ZeroDivisionError:
    print("ZeroDivisionError")
except:
    print("通用")
else:
    print("Nothing Wrong")